import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
export default new Router({
  routes: [
    {
      path: '/file',
      name: 'file',
      component: require('@/components/file/index').default
    },
    {
      path: '/dict',
      name: 'dict',
      component: require('@/components/dict/index').default
    },
    {
      path: '/content',
      name: 'content',
      component: require('@/components/content/index').default
    },
    {
      path: '/tmpl',
      name: 'tmpl',
      component: require('@/components/tmpl/index').default
    },
    {
      path: '/login',
      name: 'login',
      component: require('@/components/login/login').default
    },
    {
      path: '/home',
      name: 'home',
      component: require('@/components/home').default
    },
    {
      path: '/',
      name: 'index',
      component: require('@/components/index').default
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})
